<template>
  <div class="home">
    <my-list :list="goods"></my-list>
  </div>
</template>

<script>
// @ is an alias to /src
import axios from 'axios';
import { reactive,toRefs } from 'vue';
import myList from '../components/myList';
export default {
  name: 'HomeView',
  components: {
    myList
  },
  setup(props) {
    const data = reactive({
      goods:[], 
    })
    axios.get('https://api.shop.eduwork.cn/api/goods').then(res => {
      data.goods = res.data.goods.data;
    })
    return {
      ...toRefs(data)
    }
  }
}
</script>
